package com.yusys.pattern.mode.decorator;

/**
 * 装饰类1
 */
public class Decorator2016 extends Decortor{

    public Decorator2016(House house) {
        super(house);
    }

    @Override
    public void people() {
        super.people();//调用父类的方法表示原来的业务操作不变

        // 在原来的基础上装饰，新增操作
        findFriend();
    }

    @Override
    public void goods() {
        super.goods();

        //在原来的基础上增加了物品
        incTreasure();
    }


    public void  findFriend(){
        System.err.println("I growed");
        System.err.println("I am finding a good boy");
    }

    public void incTreasure(){
        System.err.println("I worked");
        System.err.println("A new house");
        System.err.println("A new car");
    }
}
